<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>string</title>
</head>
<body>


<script>
    var book=[
        {
            "title":"Professional JavaScript",
            "authors":[
                "peter","jack","bruce"
            ],
            year:2009,
            edition:4
        },
    ];
    var bookText=JSON.stringify(book,function (key,value) {
        switch (key) {
            case "author":
                return value.join(",");
            case "year":
                return 5000;
            case "edition":
                return undefined;
            default:
                return value;
        }
    },"----");
    // var bookText=JSON.stringify(book,null,4);
    console.log(bookText);
</script>



</body>
</html>